package com.dms.model;

import java.util.ArrayList;

import com.dms.bean.Fee;
import com.dms.bean.Student;
import com.dms.dao.FeeDao;
import com.dms.dao.StudentDao;

public class FeeModel {
	public static boolean add(int month, String dormID, String money) {
		boolean val = false;			
			try {
				Fee fee = new Fee();
				fee.setDormID(dormID);
				fee.setMonth(month);
				fee.setMoney(money);
				fee.setState(0);
				FeeDao.add(fee);
				val=true;
			}
			catch (Exception e) {
				e.printStackTrace();
			}
			
			return val;
	}
	public static ArrayList<Fee> list2(String stuID) {
		Student stu1 = StudentDao.find(stuID);
		String dormID= stu1.getDormID();
		return FeeDao.list2(dormID);
	}

	
}
